package 校招笔试.耀乘健康;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 * @author aodre , QQ : 480029069
 * @date 2023/10/9 19:52
 */
public class Main {

    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        primeFactorization(Integer.MAX_VALUE);
//        primeFactorization(24);
    }



    public static int countTriangles(int[][] points) {
        int count = 0;
        for (int i = 0; i < points.length - 2; i++) {
            for (int j = i + 1; j < points.length - 1; j++) {
                for (int k = j + 1; k < points.length; k++) {
                    if (isTriangle(points[i], points[j], points[k])) {
                        count++;
                    }
                }
            }
        }
        return count;
    }

    public static boolean isTriangle(int[] p1, int[] p2, int[] p3) {
        int x1 = p1[0], y1 = p1[1];
        int x2 = p2[0], y2 = p2[1];
        int x3 = p3[0], y3 = p3[1];
        int area = x1 * (y2 - y3) + x2 * (y3 - y1) + x3 * (y1 - y2);
        return area != 0;
    }





    public static void primeFactorization(int n) {
        Map<Integer,Integer> map = new HashMap<>();
        int t = n;
        long t1 = System.currentTimeMillis();
        for (int i = 2; i * i <= n; i++) {
            while (n % i == 0) {
                map.put(i,map.getOrDefault(i,0) + 1);
                n /= i;
            }
        }
        if(n != 1){
            map.put(n,map.getOrDefault(n,0) + 1);
        }
        ArrayList<ArrayList<Integer>> ans = new ArrayList<>();
        for (Map.Entry<Integer, Integer> entry : map.entrySet()) {
            ArrayList<Integer> list = new ArrayList<>();
            list.add(entry.getKey());
            list.add(entry.getValue());
            ans.add(list);
        }
        long t2 = System.currentTimeMillis();
        System.out.println((t2 - t1) / 1000);
        System.out.println((t2 - t1));
        if(t2 - t1 >= 1500){
            System.out.println(t);
            return ;
        }
//        System.out.println(ans);
    }


}
